package cqrtplm.service.impl;

import java.util.List;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import cqrtplm.dto.query.RtCfgDemandStatusQueryDTO;
import cqrtplm.entity.RtCfgDemandOrders;
import cqrtplm.entity.RtCfgDemandStatus;
import cqrtplm.mapper.RtCfgDemandStatusMapper;
import cqrtplm.service.IRtCfgDemandStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 需求状态Service业务层处理
 *
 * @author 江小雄
 * @date 2025-07-01
 */
@Service
public class RtCfgDemandStatusServiceImpl implements IRtCfgDemandStatusService
{
    @Autowired
    private RtCfgDemandStatusMapper rtCfgDemandStatusMapper;

    /**
     * 查询需求状态
     *
     * @param id 需求状态主键
     * @return 需求状态
     */
    @Override
    public RtCfgDemandStatus selectRtCfgDemandStatusById(String id)
    {
        return rtCfgDemandStatusMapper.selectRtCfgDemandStatusById(id);
    }

    /**
     * 新增需求状态
     *
     * @param rtCfgDemandStatus 需求状态
     * @return 结果
     */
    @Override
    public int insertRtCfgDemandStatus(RtCfgDemandStatus rtCfgDemandStatus)
    {
        return rtCfgDemandStatusMapper.insertRtCfgDemandStatus(rtCfgDemandStatus);
    }

    /**
     * 修改需求状态
     *
     * @param rtCfgDemandStatus 需求状态
     * @return 结果
     */
    @Override
    public int updateRtCfgDemandStatus(RtCfgDemandStatus rtCfgDemandStatus)
    {
        return rtCfgDemandStatusMapper.updateRtCfgDemandStatus(rtCfgDemandStatus);
    }

    /**
     * 批量删除需求状态
     *
     * @param ids 需要删除的需求状态主键
     * @return 结果
     */
    @Override
    public int deleteRtCfgDemandStatusByIds(String[] ids)
    {
        return rtCfgDemandStatusMapper.deleteRtCfgDemandStatusByIds(ids);
    }

    /**
     * 删除需求状态信息
     *
     * @param id 需求状态主键
     * @return 结果
     */
    @Override
    public int deleteRtCfgDemandStatusById(String id)
    {
        return rtCfgDemandStatusMapper.deleteRtCfgDemandStatusById(id);
    }

    @Override
    public PageInfo<RtCfgDemandStatus> selectRtCfgDemandStatusList(RtCfgDemandStatusQueryDTO queryDTO, int pageNum,
                                                                   int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<RtCfgDemandStatus> list = rtCfgDemandStatusMapper.selectRtCfgDemandStatusList(new RtCfgDemandStatus());
        return new PageInfo<>(list);
    }
}
